#ifndef __com_H
#define __com_H

#include <stdint.h>

#define	REG_COM_BAS_ADDR  0 

enum
{
  equipment_type,
	hardware_version,
	software_version,
  
  slave_addr,

  longitude_h,
  longitude_l,
  latitude_h,
  latitude_l,
 
	equipment_year,
	equipment_month,
	equipment_day,
	equipment_hour,
	equipment_minute,
	equipment_second,
	
	restore,  
	reset,
	save_configer,
	secret_key,
	report_fre,
	report_addr,
	report_qua,

  report,
};

struct S_REG_COM
{
  uint16_t 	equipment_type;
	uint16_t 	hardware_version;
	uint16_t 	software_version;
  
  uint16_t  slave_addr;

  uint16_t  longitude_h;
  uint16_t  longitude_l;
  uint16_t  latitude_h;
  uint16_t  latitude_l;
 
	uint16_t 	equipment_year;
	uint16_t 	equipment_month;
	uint16_t 	equipment_day;
	uint16_t 	equipment_hour;
	uint16_t 	equipment_minute;
	uint16_t 	equipment_second;
	
	uint16_t 	restore ;
	uint16_t 	reset;
	uint16_t	save_configer;
	uint16_t 	secret_key;
	uint16_t 	report_fre;
	uint16_t 	report_addr;
	uint16_t 	report_qua;

  uint16_t 	report;
};

extern struct S_REG_COM s_reg_com;

uint8_t  sw_com(uint16_t reg_addr_index, uint16_t msg);
#endif
